/**
 * @param {number[]} nums
 * @return {number}
 */
var maxWidthRamp = function(nums) {
    let maxWidth = 0;
    for(let i = 0; i < nums.length - 1; i++) {
        for(let j = i; j < nums.length; j++) {
            if(nums[i] <= nums[j]) {
                maxWidth = j - i > maxWidth ? j - i : maxWidth;
            }
        }
    }
    return maxWidth
};
console.log(maxWidthRamp([9,8,1,0,1,9,4,0,4,1]));